﻿var status = -1;

function action(mode, type, selection) {
    if (mode == 1) {
        status++;
    } else {
        if (status == 0) {
            cm.dispose();
        }
        status--;
    }
    if (status == 0) {
        if ((cm.getSpace(1) > 1||cm.getSpace(2) > 1||cm.getSpace(3) > 1||cm.getSpace(4) > 1)&&cm.getHyPay(3) >= 3000 && cm.getPlayer().getCSPoints(1) >= 300000) {
            cm.sendYesNo("这里是充值抽奖专区。我背包里面包含了外星碎片 法弗纳 极品徽章 坚韧意志红色等所有装备哦.如果你充值满了3000可以再这里花费30W点卷抽奖一次哦！你确定要抽奖吗？注：获得高级装备几率提高10倍。");
        } else {
            cm.sendOk("我背包里面包含了外星碎片 法弗纳 极品徽章 坚韧意志红色等装备哦。如果你累计金额满了3000可以再这里花费30万点卷抽奖一次哦！你的充值金额到3000或足够30万点卷了吗？");
            cm.safeDispose();
        }
    } else if (status == 1) {
            var item;
            var chance = Math.floor(Math.random() * 165);
			if(chance >= 0 && chance <= 50){
                var itemList = new Array(
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1262016,
1212063,
1222058,
1232057,
1242060,
1302275,
1312153,
1322203,
1332225,
1342082,
1362090,
1372177,
1382208,
1402196,
1412135,
1422140,
1432167,
1442223,
1452205,
1462193,
1472214,
1482168,
1492179,
1522094,
1532098,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1252015,
1542063,
1552063,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1122256,
1032191,
1132230,
1003893,
1113038
                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(3000)");
           } else if (chance >= 51 && chance <= 1000) {
                var itemList = new Array(
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1262016,
1212063,
1222058,
1232057,
1242060,
1302275,
1312153,
1322203,
1332225,
1342082,
1362090,
1372177,
1382208,
1402196,
1412135,
1422140,
1432167,
1442223,
1452205,
1462193,
1472214,
1482168,
1492179,
1522094,
1532098,
1252015,
1542063,
1552063,
1122256,
1032191,
1132230,
1003893,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1113038
				                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(3000)");
            } else if (chance >= 101 && chance <= 130) {
                var itemList = new Array(
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1262016,
1212063,
1222058,
1232057,
1242060,
1302275,
1312153,
1322203,
1332225,
1342082,
1362090,
1372177,
1382208,
1402196,
1412135,
1422140,
1432167,
1442223,
1452205,
1462193,
1472214,
1482168,
1492179,
1522094,
1532098,
1252015,
1542063,
1552063,
1122256,
1032191,
1132230,
1003893,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1113038
				                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(3000)");
            } else if (chance >= 131 && chance <= 150) {
                var itemList = new Array(
1152123,
1132214,
1012319,
1190302,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1262016,
1212063,
1222058,
1232057,
1242060,
1302275,
1312153,
1322203,
1332225,
1342082,
1362090,
1372177,
1382208,
1402196,
1412135,
1422140,
1432167,
1442223,
1452205,
1462193,
1472214,
1482168,
1492179,
1522094,
1532098,
1252015,
1542063,
1552063,
1122256,
1032191,
1132230,
1003893,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1113038
				                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(3000)");
            } else if (chance >= 151 && chance <= 160) {
                var itemList = new Array(2040303, //耳环智力必成卷
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1262016,
1212063,
1222058,
1232057,
1242060,
1302275,
1312153,
1322203,
1332225,
1342082,
1362090,
1372177,
1382208,
1402196,
1412135,
1422140,
1432167,
1442223,
1452205,
1462193,
1472214,
1482168,
1492179,
1522094,
1532098,
1252015,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1542063,
1552063,
1122256,
1032191,
1132230,
1003893,
1113038
                    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(3000)");
            } else {
 		var itemList = new Array(
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1262016,
1212063,
1222058,
1232057,
1242060,
1302275,
1312153,
1322203,
1332225,
1342082,
1362090,
1372177,
1382208,
1402196,
1412135,
1422140,
1432167,
1442223,
1452205,
1462193,
1472214,
1482168,
1492179,
1522094,
1532098,
1252015,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1062168,
1003801,
1042258,
1062169,
1122256,
1032191,
1132230,
1003893,
1113038,
1152123,
1132214,
1012319,
1190302,
1182017,
1003797,
1042254,
1062165,
1003798,
1042255,
1062166,
1003799,
1042256,
1062167,
1003800,
1042257,
1542063,
1552063,
1122256,
1032191,
1132230,
1003893,
1113038
		    );
                item = cm.gainGachaponItem(itemList[Math.floor(Math.random() * itemList.length)], 1, "累计金额大转盘(3000)");
	    }
            if (item != -1) {
		cm.gainNX( -300000);
                cm.sendOk("你获得了 #b#t" + item + "##k.");
		cm.dispose();
            } else {
                cm.sendOk("你确实累计金额到3000了吗或足够30万点卷?如果是,请你确认在背包的装备,消耗,其他窗口中是否有一格以上的空间?");
		cm.dispose();
            }
        } else {
            cm.sendOk("出现错误 或 您取消");
		cm.dispose();
}
}
